using System;

namespace CombatTracker.Creatures
{
  public class CreatureParameters
  {
    public string Name;
    public CreatureType Type;

    public CreatureParameters(string name, CreatureType type)
    {
      Name = name;
      Type = type;
    }
  }

  public static class CreatureFactory
  {
    public static Creature CreateCreature(CreatureParameters parameters)
    {
      Creature result;

      switch (parameters.Type)
      {
        case CreatureType.Player:
          result = new PlayerCharacter();
          break;
        case CreatureType.Monster:
          result = new Creature();
          break;
        default:
          throw new ArgumentOutOfRangeException();
      }

      result.Type = parameters.Type;
      result.Name = parameters.Name;

      return result;
    }
  }
}